package com.liang.controller;

import com.liang.entity.User;
import com.liang.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class StudentController {

    @Autowired
    UserService userService;

    @GetMapping("/student/{id}")
    public User getUserById(@PathVariable("id") Integer id){

        return userService.getUserById(id);

    }

}
